package com.qinggeng.project.tool.pay.service.impl;

import com.qinggeng.project.tool.pay.domain.PayAlipay;
import com.qinggeng.project.tool.pay.mapper.PayAlipayMapper;
import com.qinggeng.project.tool.pay.service.IPayAlipayService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 支付宝支付信息Service业务层处理
 *
 * @author qinggeng
 * @date 2020-02-13
 */
@Service
public class PayAlipayServiceImpl implements IPayAlipayService
{
    @Resource
    private PayAlipayMapper payAlipayMapper;

    /**
     * 查询支付宝支付信息
     *
     * @param payId 支付宝支付信息ID
     * @return 支付宝支付信息
     */
    @Override
    public PayAlipay selectPayAlipayById(Long payId)
    {
        return payAlipayMapper.selectPayAlipayById(payId);
    }

    /**
     * 查询支付宝支付信息列表
     *
     * @param payAlipay 支付宝支付信息
     * @return 支付宝支付信息
     */
    @Override
    public List<PayAlipay> selectPayAlipayList(PayAlipay payAlipay)
    {
        return payAlipayMapper.selectPayAlipayList(payAlipay);
    }

    /**
     * 新增支付宝支付信息
     *
     * @param payAlipay 支付宝支付信息
     * @return 结果
     */
    @Override
    public int insertPayAlipay(PayAlipay payAlipay)
    {
        return payAlipayMapper.insertPayAlipay(payAlipay);
    }

    /**
     * 修改支付宝支付信息
     *
     * @param payAlipay 支付宝支付信息
     * @return 结果
     */
    @Override
    public int updatePayAlipay(PayAlipay payAlipay)
    {
        return payAlipayMapper.updatePayAlipay(payAlipay);
    }

    /**
     * 批量删除支付宝支付信息
     *
     * @param payIds 需要删除的支付宝支付信息ID
     * @return 结果
     */
    @Override
    public int deletePayAlipayByIds(Long[] payIds)
    {
        return payAlipayMapper.deletePayAlipayByIds(payIds);
    }

    /**
     * 删除支付宝支付信息信息
     *
     * @param payId 支付宝支付信息ID
     * @return 结果
     */
    @Override
    public int deletePayAlipayById(Long payId)
    {
        return payAlipayMapper.deletePayAlipayById(payId);
    }

    @Override
    public PayAlipay selectPayAlipayByOutTradeNo(String outTradeNo) {
        return payAlipayMapper.selectPayAlipayByOutTradeNo(outTradeNo);
    }
}
